# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-pyof
pkgname=('python2-pyof' 'python-pyof')
_pkgname=pyof
pkgver=0.1.0
pkgrel=8
pkgdesc='Openfoam PostProcessing Python Tools.'
arch=('any')
url='https://pypi.org/project/pyof/#files'
license=('GPL2')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('c13c22e9d281b85faf8e0ff689152c525fa853588dca4fbdd45ff6c1b03fe390cfad78ee0fd4ba010aca545c4e14bf9366d079015260a7897fb01f4a23808074')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-pyof() {
  depends=('python2' 'python2-numpy' 'python2-scipy' 'python2-matplotlib')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

package_python-pyof() {
  depends=('python' 'python-numpy' 'python-scipy' 'python2-matplotlib')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

